package com.smedi.ismedi.authoritymanagement.core.domain.service.impl;

import com.smedi.ismedi.authoritymanagement.core.domain.aggregatemodel.Element;
import com.smedi.ismedi.authoritymanagement.core.domain.dto.ElementQuery;
import com.smedi.ismedi.authoritymanagement.core.domain.repository.ElementRepository;
import com.smedi.ismedi.authoritymanagement.core.domain.service.ElementDomainService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 业务服务实体类
 *
 * @author xienannan
 * @date 2021/08/28
 */
@Service
@AllArgsConstructor
public class ElementDomainServiceImpl implements ElementDomainService {
    public final ElementRepository elementRepository;

    @Override
    public Element createElement(Element element) {
        return elementRepository.saveElement(element);
    }

    @Override
    public Element updateElement(Element element) {
        return elementRepository.saveElement(element);
    }

    @Override
    public void removeElement(ElementQuery elementQuery) {
        elementRepository.deleteElement(elementQuery);
    }
}
